package com.eiokey.tobebest.mvvm.viewmodel;

import com.eiokey.baselibrary.base.ui.BaseViewModel;
import com.eiokey.baselibrary.utils.LogUtils;
import com.eiokey.linkbus.livedata.ObservableLiveData;
import com.eiokey.linkbus.message.LinkBusMsgManager;
import com.eiokey.tobebest.base.MessageId;

/**
 * description
 * use
 * param
 * return
 * @author JetQiao
 * @date
 */
public class MainViewModel extends BaseViewModel {


    public ObservableLiveData<String> buttonStr = new ObservableLiveData<>();
    public ObservableLiveData<String> textStr = new ObservableLiveData<>();


    int i = 0;
    int j = 0;


    public void changeBtnText() {
        ++i;
        buttonStr.set("button点击了" + i + "次");
        textStr.set("TextView改变了" + i + "次");
        LogUtils.d("执行此方法" + i);
    }


    public void doNoting() {
        ++j;
        LinkBusMsgManager.getInstance().sendMessage(MessageId.MESSAGE_BUTTON_TEST, "This is a test !  " + j);
    }
}